package com.shenjialin.util;

import com.shenjialin.Game.GameFrame;
import com.shenjialin.Tank.Tank;

import java.awt.*;

/**
 * 游戏中的常量类
 */
public class Constant {
    /****************游戏窗口相关*********************/
    public static final String GAME_TITLE = "坦克大战";

    public static final int FRAME_WIDTH = 981;
    public static final int FRAME_HEIGHT = 800;

    // 动态获得系统屏幕的宽和高

    public static final int SCREEN_W = Toolkit.getDefaultToolkit().getScreenSize().width;
    public static final int SCREEN_H = Toolkit.getDefaultToolkit().getScreenSize().height;

    public static final int FRAME_X = SCREEN_W - FRAME_WIDTH>>1;
    public static final int FRAME_Y = SCREEN_H - FRAME_HEIGHT>>1;


    /*******游戏菜单相关*******/

    public static final int STATE_MENU = 0;
    public static final int STATE_HELP = 1;
    public static final int STATE_ABOUT = 2;
    public static final int STATE_RUN = 3;
    public static final int STATE_OVER = 4;

    public static final int DEFAULT_X = FRAME_WIDTH/2;

    public static final int DEFAULT_Y = GameFrame.titleBarH + Tank.RADIUS*3;

    public static final String[] MENUS={
            "开始游戏",
            "继续游戏",
            "游戏帮助",
            "游戏关于",
            "退出游戏"
    };

    public static final String OVER_STR0 = "ESC键 退出游戏";
    public static final String OVER_STR1 = "ENTER键回到主菜单";


    //字体设置
    public static final Font GAME_FONT = new Font("宋体",Font.BOLD,24);
    public static final Font TANK_NAME_FONT = new Font("黑体",Font.BOLD,12);

    // 游戏刷新
    public static final int REPAINT_INTERVAL = 33;

    //最大敌人数量
    public static final int ENEMY_MAX_COUNT = 10;

    // 生成 敌人坦克的间隔
    public static final int ENEMY_BORN_INTERVAL = 3000;


    // ai坦克 改变状态 量
    public static final int ENEMY_AI_INTERVAL = 1500;

    // 敌人每一帧发射子弹的 概率
    public static final double  ENEMY_AI_FIRE_PERCENT = 0.05;

    public static final double TILE_PERCENT = 0.5;

    // home的名字
    public static final String HOME_NAME = "死";

    // 默认高10格 宽14格
    public static final int FRAME_COUNT_HEIGHT = 10;
    public static final int FRAME_COUNT_WEIGHT = 14;
}
